﻿@using Aspire.Dashboard.Model
@using Aspire.Dashboard.Resources
@using System.Globalization
@using Aspire.Dashboard.Utils

@if (Resource.CreationTimeStamp is {} timeStamp)
{
    // Don't include milliseconds as resource server returned time stamp is second precision.
    @FormatHelpers.FormatTimeWithOptionalDate(TimeProvider, timeStamp)
}

@code {
    [Inject]
    public required BrowserTimeProvider TimeProvider { get; init; }

    [Parameter, EditorRequired]
    public required ResourceViewModel Resource { get; set; }
}
